package com.qingzhou.system.controller;

import com.qingzhou.common.core.constants.DataSourceConstant;
import org.apache.ibatis.solon.annotation.Db;
import org.noear.solon.annotation.*;
import org.noear.solon.data.dynamicds.DynamicDs;
import org.noear.solon.validation.annotation.Valid;
import org.noear.solon.validation.annotation.Validated;

@Valid
@Controller
@Mapping("hi")
public class HelloController {

    /**
     * 切换子数据源
     * @param user
     * @return
     */
//    @DynamicDs(DataSourceConstant.DATA_SOURCE_SLAVE_1)
//    @Get
//    @Mapping("/getUserBoot")
//    public User helloUserBoot(Long id) {
//        System.err.println(id);
//        User user = userMapper.selectByUserId(id);
//        return user;
//    }

    /**
     * 数据校验
     */
//    @Post
//    @Mapping("postUser")
//    public User helloUser(@Body @Validated User user) {
//        System.err.println(user);
//        userMapper.insert(user);
//        return user;
//    }

}
